<template>
  <div ref="main" style="width:600px;height:200px" />
</template>

<script>
import pie from '@/views/dashboard/compoments/pie.js'
import { getIndexApi } from '@/api/index'
import * as Echarts from 'echarts'
export default {
  name: 'VueAdminTemplateMasterPie',
  data() {
    return {
    }
  },
  created() {
    this.initData()
  },

  mounted() {
    this.echarts = Echarts.init(this.$refs.main)
    this.echarts.setOption(pie)
  },

  methods: {
    async  initData() {
      const res = await getIndexApi()
      const value1 = res.data.user.user_man
      const value2 = res.data.user.user_woman
      pie.series[0].data[0].value = value1
      pie.series[0].data[1].value = value2
      console.log(value1, value2)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
